<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
  </head>

  <body>
    <div id="app" style="height: 100vh">
      <!-- Webamp will attempt to center itself within this div -->
    </div>
    <script type="module">
      import Webamp from "https://unpkg.com/webamp@^2";
      const webamp = new Webamp({
        // Optional. An array of objects representing skins.
        // These will appear in the "Options" menu under "Skins".
        // NOTE: These URLs must be served with the correct CORs headers.
        // https://docs.webamp.org/docs/guides/cors
        //
        // These will appear in the dropdown menu under "Skins".
        availableSkins: [
          {
            url: "https://archive.org/cors/winampskin_Zelda_Amp/Zelda-Amp.wsz",
            name: "Zelda Amp",
          },
          {
            url: "https://archive.org/cors/winampskin_Green-Dimension-V2/Green-Dimension-V2.wsz",
            name: "Green Dimension V2",
          },
          {
            url: "https://archive.org/cors/winampskin_mac_os_x_1_5-aqua/mac_os_x_1_5-aqua.wsz",
            name: "Mac OSX v1.5 (Aqua)",
          },
        ],
        initialSkin: {
          url: "https://archive.org/cors/winampskin_Zelda_Amp/Zelda-Amp.wsz",
        },
        initialTracks: [
          {
            metaData: {
              artist: "DJ Mike Llama",
              title: "Llama Whippin' Intro",
            },
            // NOTE: Your audio file must be served from the same domain as your HTML
            // file, or served with permissive CORS HTTP headers:
            // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
            url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
            duration: 5.322286,
          },
        ],
      });

      // Returns a promise indicating when it's done loading.
      webamp.renderWhenReady(document.getElementById("app"));
    </script>
  </body>
</html>
